ostree-sysroot: make simple_write_deployment smarter
authorJonathan Lebon <jlebon@redhat.com>
Wed, 23 Aug 2017 16:15:46 +0000 (12:15 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Fri, 25 Aug 2017 01:02:15 +0000 (01:02 +0000)
commit9342be6e34b26891c38b671ec285bdcbc9107acd
tree0f91f5606ecb11213356aa9424f468d672a6f8d2
parentd0f40a6af8fb391d5ee34ca6d4bc2abfc5b21e16
ostree-sysroot: make simple_write_deployment smarter

This is a follow-up to https://github.com/ostreedev/ostree/pull/1097.
We make simple_write_deployment smart enough so that it can be used for
rpm-ostree's purposes. This is mostly an upstreaming of logic that
already existed there.

Notably we correctly append NOT_DEFAULT deployments *after* the booted
deployment and we now support RETAIN_PENDING and RETAIN_ROLLBACK flags
to have more granularity on deployment pruning.

Expose these new flags on the CLI using new options (as well as expose
the previously existing NOT_DEFAULT flag as --not-as-default).

I couldn't add tests for --retain-pending because the merge deployment
is always the topmost one. Though I did check that it worked in a VM.

Closes: #1110
Approved by: cgwalters
bash/ostree
man/ostree-admin-deploy.xml
src/libostree/ostree-sysroot.c
src/libostree/ostree-sysroot.h
src/ostree/ot-admin-builtin-deploy.c
tests/admin-test.sh
tests/test-admin-deploy-grub2.sh
tests/test-admin-deploy-syslinux.sh
tests/test-admin-deploy-uboot.sh